<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@include file="/common/common.jsp"%>
<%@include file="/common/skins/skin0/component.jsp" %>
<h:css href="/css/style1/style-custom.css"/>
<%--
- Author(s): pengweiling
- Date: 2012-07-22 16:45:17
- Description:
--%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>
      物品寄存
    </title>
  </head>
  <body>
    <e:datasource name="wematerialstorage" type="entity" path="com.hms.OrderMgr.order.WeMaterialstorage" />
    <h:form name="data_form" action="com.hms.OrderMgr.WeMaterialstorageMaintain.flow" method="post" onsubmit="return checkForm(this);">
      <h:hidden property="wematerialstorage/istorageid" />
      <l:equal property="_eosLastAccessAction" targetValue="update">
        <input type="hidden" name="_eosFlowAction" value="updateSubmit" >
      </l:equal>
      <l:equal property="_eosLastAccessAction" targetValue="insert">
        <input type="hidden" name="_eosFlowAction" value="insertSubmit" >
      </l:equal>
      <h:hiddendata property="criteria" />
      <h:hidden property="page/begin"/>
      <h:hidden property="page/length"/>
      <h:hidden property="page/isCount"/>
      <h:hidden property="wematerialstoragev/istorageid"/>
      <input type="hidden" name="actionName" value="NORMAL">
      <dataform id= "1704ab5b-3f9c-4eb9-8380-f96fe4952218">
        <w:panel id="panel1" width="100%" title="物品寄存">
          <table align="center" border="0" width="100%" class="form_table">
            <h:hidden property="wematerialstoragev/iroomid"/>
            <tr>                 
              <td class="form_label">
                客单
              </td>
              <td colspan="1">
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <w:lookup property="wematerialstoragev/igresid"  
                            style="width:256px;" 
                            displayProperty="wematerialstoragev/cgresno"
                            lookupUrl="com.hms.commonPick.WeOrdersVSelect.flow"
                            allowInput="false"
                            onReturnFunc="setInfo"
                            dialogTitle="选择客单"
                            validateAttr="allowNull=false"/><font style="color:red">*</font>
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="wematerialstoragev/cgresno" style="width:256px;" readonly="true"/>
                </l:notEqual>                          
              </td>
            </tr>            
            <tr>
              <td class="form_label">
                房号
              </td>
              <td colspan="1">
                <h:text property="wematerialstoragev/croomno" style="width:256px;" readonly="true"/>
              </td>
            </tr>
            <tr>              
              <td class="form_label">
                客人姓名
              </td>
              <td colspan="1">
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                    <h:text property="wematerialstoragev/cguestname" style="width:256px;" validateAttr="allowNull=false"/><font style="color:red">*</font>
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                   <h:text property="wematerialstoragev/cguestname" style="width:256px;" readonly="true"/>
                </l:notEqual>  
              </td>
            </tr>
            <tr>
              <td class="form_label">
                凭证号
              </td>
              <td colspan="1">
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                    <h:text property="wematerialstoragev/cvoucherno" style="width:256px;" />
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                   <h:text property="wematerialstoragev/cvoucherno" style="width:256px;" readonly="true"/>
                </l:notEqual>                                
              </td>
            </tr>
            <tr>                 
              <td class="form_label">
                数量
              </td>
              <td colspan="1">
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                    <h:text property="wematerialstoragev/nqty" style="width:256px;" validateAttr="minValue=1;maxValue=10000;type=naturalNumber;allowNull=false"/><font style="color:red">*</font>
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                   <h:text property="wematerialstoragev/nqty" style="width:256px;" readonly="true"/>
                </l:notEqual>  
              </td>
            </tr>
            <tr>
              <td class="form_label">
                寄存内容
              </td>
              <td colspan="1">
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                    <h:text property="wematerialstoragev/cdeatails" style="width:90%"  validateAttr="allowNull=false"/><font style="color:red">*</font>
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                   <h:text property="wematerialstoragev/cdeatails" style="width:100%"  readonly="true"/>
                </l:notEqual>  
              </td>
            </tr>
            <tr>                 
              <td class="form_label">
                备注
              </td>
              <td colspan="1">
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                    <h:textarea property="wematerialstoragev/creamrks" style="width:100%" />
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                   <h:textarea property="wematerialstoragev/creamrks" style="width:100%"  readonly="true"/>
                </l:notEqual>                
              </td>
            </tr>
            <tr>
              <td class="form_label">
                登记时间
              </td>
              <td colspan="1">
                <w:date property="wematerialstoragev/dcreated" style="width:256px;" readOnly="true"/>
              </td>
            </tr>
            <tr>                 
              <td class="form_label">
                领取时间
              </td>
              <td colspan="1">
                <w:date property="wematerialstoragev/dtaked" style="width:256px;" readOnly="true"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                状态
              </td>
              <td colspan="1">
               <h:select disabled="true" property="wematerialstoragev/cstate"  style="width:256px;color:blue">
                  <option value="N">未取</option>
                  <option value="F">已取</option>
                  <option value="C">取消</option>  
                </h:select>                                
              </td>
            </tr>
            <tr>                 
              <td class="form_label">
                创建人
              </td>
              <td colspan="1">
                <h:text property="wematerialstoragev/createdname" style="width:256px;" readonly="true" />
              </td>
            </tr>
            <tr>
              <td class="form_label">
                领取人
              </td>
              <td colspan="1">
                <h:text property="wematerialstoragev/takedname" style="width:256px;" readonly="true"  />
              </td>
            </tr>
            <tr class="form_bottom">
              <td colspan="4">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                   <input type="submit" value="保存" class="button">
                </l:equal>
                
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <l:equal property="wematerialstoragev/cstate" targetValue="N">
                     <input type="button" value="取回" class="button" onclick="getStorage()">
                     <input type="button" value="取消" class="button"  onclick="cancelStorage()">
                  </l:equal>
                </l:notEqual>
                <input type="button" value="返回" onclick="javascript:history.go(-1);" class="button">
              </td>
            </tr>
          </table>
        </w:panel>
      </dataform>
    </h:form>
    
    <script>
      function getStorage(){
        $name("actionName").value = "GET";
        $name("data_form").submit()
      }
      
      function cancelStorage(){
        $name("actionName").value = "CANCEL";
        $name("data_form").submit()
      }
      
      function setInfo(args){
         if (args){
            $name("wematerialstoragev/croomno").value = args[3];
            $name("wematerialstoragev/cguestname").value = args[4];
            $name("wematerialstoragev/iroomid").value = args[2];
         }else{
            $name("wematerialstoragev/croomno").value = "";
            $name("wematerialstoragev/cguestname").value = "";
            $name("wematerialstoragev/iroomid").value = "";
         }
         return true;
      
      }
            
    </script>
        
  </body>
</html>
